class Anmail{
    name:string;
    age:number;
    constructor(name:string,age:number){
        this.name=name
        this.age=age
    }
    // 公有的
    public say(){
        console.log(this.name);
        this.eat()
    }
    // 私有的
    private eat(){
        console.log("我是私有的");
    }
    // 受保护的
    protected sleep(){
        console.log("我是受保护的");
        
    }
}

class Dog extends Anmail{
    constructor(name:string,age:number){
        // super  子类调用父类的东西
        super(name,age)
    }
    run(){
        this.say()
        this.sleep()
    }
}
let dog=new Dog("小黑",19)
// console.log();
dog.run()